<table id="kgpList" data-options="title:'参数列表',loadMsg:'数据加载中...',toolbar:'#kgpListToolbar',fit:true,striped:true,
	singleSelect:true,border:false,pagination:true"></table>
<div id="kgpListToolbar" style="padding:5px;">
	参数类型：<input id="kgpType" data-options="valueField:'value',textField:'label',panelHeight:'auto',editable:false">&nbsp;
	参数KEY：<input id="kgpKey" class="easyui-textbox" style="width:150px">
	<a href="javascript:kgpSearch()" class="easyui-linkbutton" iconCls="icon-search">查询</a>&nbsp;
	<a href="javascript:kgpReset()" class="easyui-linkbutton" iconCls="icon-undo">重置</a>&nbsp;
	<a href="javascript:kgpOpenDialog(null)" class="easyui-linkbutton" iconCls="icon-add">新增</a>
</div>

<div id="kgpDialog" data-options="closable:false,closed:true,modal:true">
	<form id="kform" class="easyui-form">
		<div>
			<input name="cmmv" id="kgpCmmv" data-options="label:'类型:',labelAlign:'right',valueField:'value',textField:'label',panelHeight:'auto',
				editable:false,required:true" style="width:200px;">
		</div>
		<div>
			<input name="pkey" id="kgpfKey" class="easyui-textbox" data-options="label:'键:',labelAlign:'right',required:true" style="width:95%;"/>
		</div>
		<div>
			<input name="pvalue" id="kgpValue" class="easyui-textbox" data-options="label:'值:',labelAlign:'right',required:true" style="width:95%;"/>
	    </div>
	    <div>
			<input name="describes" id="kgpDescribes" class="easyui-textbox" data-options="label:'描述:',labelAlign:'right',multiline:true,required:true" 
				style="width:95%;height:40px;"/>
	    </div>
	    <input type="hidden" name="id">
	</form>
</div>
	
<script type="text/javascript" src="cusy/js/global_param.js"></script>
<script type="text/javascript">
$(function() {
	$(kgpType).combobox({ data: paramTypeData });
	$(kgpCmmv).combobox({ data: paramTypeData });
	
	$(kgpList).datagrid({
		columns: [[
			{field:'pkey', title:'键', halign:'center', width:200},
			{field:'pvalue', title:'值', halign:'center', width:200},
			{field:'cmmv', title:'类型', halign:'center', width:80, formatter:function(value, row, index){
				if ("ENV" == value) return "环境变量";
				if ("GLOBAL" == value) return "全局变量";
				return "";
			}},
			{field:'id', title:'操作', halign:'center', width:125, formatter:function(value, row, index){
				return '<a class="kgpEdit" href="javascript:kgpOpenDialog(\''+value+'\')"><i class="fa fa-edit fa-lg"></i> 编辑</a>'+ 
				'<a class="kgpDel" style="color:red;" href="javascript:kgpDelete(\''+value+'\',\''+row.pkey+'\')"><i class="fa fa-trash fa-lg"></i> 删除</a>'
			}}
		]],
		loader: kgpDatagridLoader,
		loadFilter: datagridFilter,
		onClickRow: datagridRowUnselect,
		onLoadSuccess: function(resultData) {
			datagridReqErr(this, resultData, 'key', 4);
			$(".kgpEdit").linkbutton({ height: 23, plain: true });
			$(".kgpDel").linkbutton({ height: 23, plain: true });
		}
	});
});
</script>